home *** CD-ROM | disk | FTP | other *** search
/ Innerspace / Innerspace.iso / INNERPRJ.EXE / INNERPRJ.DXR / 00908_Movie script .ls < prev    next >
Encoding:
Text File  |  1994-12-14  |  8.0 KB  |  275 lines

  1. on startMovie
  2.   global buttonProp, innDataTable, gFile, gPrevTxt, gPrevious
  3.   set buttonProp to [#plusButton: 0, #minButton: 0, #pButton: 0, #nxtButton: 0, #prvButton: 0, #soundButton: 1, #nameButton: 0]
  4.   set innDataTable to []
  5.   set gPrevTxt to EMPTY
  6.   set gPrevious to EMPTY
  7.   if the machineType = 256 then
  8.     set gFile to FileIO(mnew, "read", the pathName & "data\" & "inData.txt")
  9.   else
  10.     set gFile to FileIO(mnew, "read", the pathName & "data:" & "inData.txt")
  11.   end if
  12.   loadTables()
  13. end
  14.  
  15. on loadTables
  16.   global buttonProp, innDataTable, gFile
  17.   set index to 1
  18.   set eofInd to EMPTY
  19.   set theRecord to EMPTY
  20.   repeat while eofInd <> "endData"
  21.     set theRecord to gFile(mReadLine)
  22.     if word 1 of theRecord = "begin" then
  23.       set temp to word 1 of theRecord & " " & word 2 of theRecord
  24.       addAt(innDataTable, index, temp)
  25.     else
  26.       addAt(innDataTable, index, word 1 of theRecord)
  27.       set eofInd to word 1 of theRecord
  28.     end if
  29.     set index to index + 1
  30.   end repeat
  31. end
  32.  
  33. on positionCat category
  34.   global innDataTable, buttonProp, pos, theCast, current, gPrevious
  35.   set pos to 0
  36.   set pos to getOne(innDataTable, category)
  37.   set pos to pos + 1
  38.   set theCast to getAt(innDataTable, pos)
  39.   set current to theCast & ".pct"
  40.   set the castNum of sprite 1 to the number of cast current
  41.   if gPrevious = EMPTY then
  42.     nothing()
  43.   else
  44.     unLoadCast(gPrevious)
  45.   end if
  46.   set gPrevious to current
  47.   checkNavigation(4, 5, "next", "previous")
  48.   if getaProp(buttonProp, #soundButton) then
  49.     if the machineType = 256 then
  50.       sound playFile 2, the pathName & "data\sound\" & theCast & ".aif"
  51.     else
  52.       sound playFile 2, the pathName & "data:sound:" & theCast & ".aif"
  53.     end if
  54.   end if
  55. end
  56.  
  57. on checkNavigation nextSprite, prevSprite, nextBut, prevBut
  58.   global pos, innDataTable, buttonProp, prv, nxt, curpos
  59.   set curpos to getAt(innDataTable, pos)
  60.   set prv to getAt(innDataTable, pos - 1)
  61.   if word 1 of prv = "begin" then
  62.     setaProp(buttonProp, #prvButton, 1)
  63.     set the castNum of sprite prevSprite to the number of cast (prevBut & "Gray")
  64.   else
  65.     setaProp(buttonProp, #prvButton, 0)
  66.     set the castNum of sprite prevSprite to the number of cast prevBut
  67.   end if
  68.   set nxt to getAt(innDataTable, pos + 1)
  69.   if word 1 of nxt = "end" then
  70.     setaProp(buttonProp, #nxtButton, 1)
  71.     set the castNum of sprite nextSprite to the number of cast (nextBut & "Gray")
  72.   else
  73.     setaProp(buttonProp, #nxtButton, 0)
  74.     set the castNum of sprite nextSprite to the number of cast nextBut
  75.   end if
  76.   updateStage()
  77. end
  78.  
  79. on showForward nextSprite, prevSprite, nextBut, prevBut
  80.   global innDataTable, buttonProp, pos, theCast, current, gPrevious
  81.   set pos to pos + 1
  82.   set theCast to getAt(innDataTable, pos)
  83.   set current to theCast & ".pct"
  84.   set the castNum of sprite 1 to the number of cast current
  85.   unLoadCast(gPrevious)
  86.   set gPrevious to current
  87.   checkNavigation(nextSprite, prevSprite, nextBut, prevBut)
  88.   if getaProp(buttonProp, #soundButton) then
  89.     if the machineType = 256 then
  90.       sound playFile 2, the pathName & "data\sound\" & theCast & ".aif"
  91.     else
  92.       sound playFile 2, the pathName & "data:sound:" & theCast & ".aif"
  93.     end if
  94.   end if
  95. end
  96.  
  97. on showBack nextSprite, prevSprite, nextBut, prevBut
  98.   global innDataTable, buttonProp, pos, theCast, current, gPrevious
  99.   set pos to pos - 1
  100.   set theCast to getAt(innDataTable, pos)
  101.   set current to theCast & ".pct"
  102.   set the castNum of sprite 1 to the number of cast current
  103.   unLoadCast(gPrevious)
  104.   set gPrevious to current
  105.   checkNavigation(nextSprite, prevSprite, nextBut, prevBut)
  106.   if getaProp(buttonProp, #soundButton) then
  107.     if the machineType = 256 then
  108.       sound playFile 2, the pathName & "data\sound\" & theCast & ".aif"
  109.     else
  110.       sound playFile 2, the pathName & "data:sound:" & theCast & ".aif"
  111.     end if
  112.   end if
  113. end
  114.  
  115. on autoPlay
  116.   global innDataTable, buttonProp, pos, whichCat
  117.   positionCat(whichCat)
  118.   set the castNum of sprite 6 to the number of cast "pause"
  119.   set the castNum of sprite 3 to the number of cast "fun facts"
  120. end
  121.  
  122. on CheckSound
  123.   global nxt, buttonProp
  124.   if getaProp(buttonProp, #soundButton) then
  125.     if soundBusy(2) then
  126.       nothing()
  127.     else
  128.       if word 1 of nxt = "end" then
  129.         set the castNum of sprite 6 to the number of cast "auto play"
  130.         go("dispCon")
  131.       else
  132.         MakeInvisible(12, 12, 0)
  133.         set the castNum of sprite 3 to the number of cast "fun facts"
  134.         showForward(4, 5, "next", "previous")
  135.       end if
  136.     end if
  137.   else
  138.     if the timer < (60 * 20) then
  139.       nothing()
  140.     else
  141.       if word 1 of nxt = "end" then
  142.         set the castNum of sprite 6 to the number of cast "auto play"
  143.         go("dispCon")
  144.       else
  145.         MakeInvisible(12, 12, 0)
  146.         set the castNum of sprite 3 to the number of cast "fun facts"
  147.         showForward(4, 5, "next", "previous")
  148.         startTimer()
  149.       end if
  150.     end if
  151.   end if
  152. end
  153.  
  154. on pausePlay
  155.   set the castNum of sprite 6 to the number of cast "auto play"
  156.   updateStage()
  157.   go("dispCon")
  158. end
  159.  
  160. on dispTitles
  161.   global theCast, gPrevTxt
  162.   set the castNum of sprite 11 to the number of cast (theCast & ".ttl")
  163.   set the castNum of sprite 12 to the number of cast (theCast & ".txt")
  164.   updateStage()
  165.   if gPrevTxt = EMPTY then
  166.     nothing()
  167.   else
  168.     unLoadCast(gPrevTxt)
  169.   end if
  170.   set gPrevTxt to theCast & ".txt"
  171. end
  172.  
  173. on magnify
  174.   global theCast, magFactor
  175.   set magFactor to magFactor + 1
  176.   set magCast to theCast & magFactor & ".pct"
  177.   set the castNum of sprite 1 to the number of cast magCast
  178.   updateStage()
  179.   checkMagButtons()
  180. end
  181.  
  182. on reduce
  183.   global theCast, magFactor
  184.   set magFactor to magFactor - 1
  185.   if magFactor = 1 then
  186.     set magCast to theCast & ".pct"
  187.     set the castNum of sprite 1 to the number of cast magCast
  188.   else
  189.     set magCast to theCast & magFactor & ".pct"
  190.     set the castNum of sprite 1 to the number of cast magCast
  191.   end if
  192.   updateStage()
  193.   checkMagButtons()
  194. end
  195.  
  196. on checkMagButtons
  197.   global magFactor
  198.   if (magFactor - 1) < 1 then
  199.     setaProp(buttonProp, #minButton, 1)
  200.     set the castNum of sprite 8 to the number of cast "MIGray"
  201.   else
  202.     setaProp(buttonProp, #minButton, 0)
  203.     set the castNum of sprite 8 to the number of cast "MI"
  204.   end if
  205.   if (magFactor + 1) > 5 then
  206.     setaProp(buttonProp, #plusButton, 1)
  207.     set the castNum of sprite 6 to the number of cast "MGray"
  208.   else
  209.     setaProp(buttonProp, #plusButton, 0)
  210.     set the castNum of sprite 6 to the number of cast "M"
  211.   end if
  212.   updateStage()
  213. end
  214.  
  215. on HouseKeeping
  216.   global sportWordH, countryWordH, sportWordV, countryWordV, charCount, dupList, sportInitH, countryInitH, done, currCount, showMe
  217.   set sportWordH to []
  218.   set answer to 0
  219.   set done to 0
  220.   set currCount to 0
  221.   set charCount to 0
  222.   puppetSound(0)
  223. end
  224.  
  225. on LoadPos
  226.   global sportWordH, countryWordH, sportWordV, countryWordV, charCount, sportInitH, countryInitH, sportInitV, countryInitV, done, puzzle1V, puzzle2V, puzzle3V, flag1V, flag2V, flag3V
  227.   set puzzle1V to 157
  228.   set puzzle2V to 228
  229.   set puzzle3V to 299
  230.   set done to 0
  231.   loadHorzpos(sportWordH, 2, 19)
  232. end
  233.  
  234. on loadHorzpos horzList, startSprite, endSprite
  235.   set index to startSprite
  236.   repeat while index <= endSprite
  237.     addAt(horzList, index, the locH of sprite index)
  238.     set index to index + 1
  239.   end repeat
  240. end
  241.  
  242. on PuzzleMove idxNumber, whichSprite, vertPos
  243.   global sportWordH, charCount, inPlace
  244.   if getAt(sportWordH, idxNumber) = 0 then
  245.     exit
  246.   end if
  247.   set horzPos to getAt(sportWordH, idxNumber)
  248.   MoveTheSprite(vertPos, horzPos, 0, 0, whichSprite, "Glass Toast", 0)
  249.   if inPlace then
  250.     setAt(sportWordH, idxNumber, 0)
  251.     set charCount to charCount + 1
  252.   end if
  253. end
  254.  
  255. on checkLable
  256.   global puzProp, puzCount, puzLable
  257.   set puzCount to puzCount + 1
  258.   if puzCount = 5 then
  259.     set the castNum of sprite 13 to the number of cast "next puzzleGray"
  260.     updateStage()
  261.   end if
  262.   set puzDup to 1
  263.   repeat while puzDup = 1
  264.     set puzLableSuf to random(10)
  265.     set puzLable to "puzzle" & puzLableSuf
  266.     set nxt to getaProp(puzProp, puzLable)
  267.     if nxt = 1 then
  268.       nothing()
  269.       next repeat
  270.     end if
  271.     set puzDup to 0
  272.     setaProp(puzProp, puzLable, 1)
  273.   end repeat
  274. end
  275.